'''
@Project ：python-study
@File    ：9.3调整视觉元素.py
@IDE     ：PyCharm
@Author  ：SUNLIN
@Date    ：2025/3/12 17:22:40
'''
import matplotlib.pyplot as plt

# 画布
plt.figure()
# X轴、Y轴
x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
y = [1, 2, 3, 4, 5, 6, 7, 8, 9]

x2 = [3, 4, 5, 6, 7, 8, 9, 10, 11]
y2 = [1, 2, 3, 4, 5, 6, 7, 8, 9]

# 轴标签
plt.xlabel = 'xLabel'
plt.ylabel = 'yLabel'

# 标题
plt.title('Create A Figure with line Elements')

# 数据项标识
plt.scatter(x=x, y=y, color="red", marker="*", label="Sample A")
plt.scatter(x=x2, y=y2, color="blue", marker="+", label="Sample B")
# 网格
plt.grid(True)

# 注释说明
plt.legend()

# 主刻度标签
plt.xticks(ticks=[0, 4, 6, 8, 10, 12, 14])
plt.yticks(ticks=[0, 3, 5, 7, 9, 11, 13])

plt.minorticks_on()

# 展示
plt.show()
